package cn.lyjuan.android.demofive.ui.tab.tabhost2;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import cn.lyjuan.android.demofive.R;

/**
 * Created by chad on 2016/3/1.
 */
public class TabHostActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);

        super.onCreate(savedInstanceState);

        this.setContentView(R.layout.ui_tabhost2);

        TabHost th = (TabHost) this.findViewById(R.id.ui_tabhost2_tab);
        th.setup();// 初始化Tab容器

        Resources rs = this.getResources();

        // First
        th.addTab(th.newTabSpec("First1").setIndicator("First2", rs.getDrawable(R.drawable.ui_tabhost_first)).setContent(R.id.ui_tabhost2_first));

        th.addTab(th.newTabSpec("Second1").setIndicator("Second2", rs.getDrawable(R.drawable.ui_tabhost_second)).setContent(R.id.ui_tabhost2_second));
    }
}
